package com.baizhi.hello;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


// 默认的queue为非独占的，可以持久化的，非自动删除的queue
@Component
@RabbitListener(queuesToDeclare = @Queue(value = "hello", autoDelete = "false", durable = "true",exclusive = "false"))// 对应的queue名称
public class HelloCustomer {

    @RabbitHandler// 处理类
    public void receive1(String message){
        System.out.println("message = " + message);
    }


}
